package cn.com.utt.unms.vo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import cn.com.utt.common.vo.User;

public class AccountInfo {

	private Long id;
	private String username;
	private String password;
	private Long parentId;
	private Long groupId;
	private List<Integer> auths;
	private String authInfo;
	private String remark;
	private Date lastlogin;
	private Date createTime;
	private String parent;
	private String email;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public String getPassword() {
		return password;
	}

	public Long getParentId() {
		return parentId;
	}

	public List<Integer> getAuths() {
		return auths;
	}

	public String getRemark() {
		return remark;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public void setAuths(List<Integer> auths) {
		this.auths = auths;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Long getGroupId() {
		return groupId;
	}

	public void setGroupId(Long groupId) {
		this.groupId = groupId;
	}

	public String getLastlogin() {
		if (this.lastlogin == null) {
			return "";
		}
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return formatter.format(lastlogin);
	}

	public String getParent() {
		return parent;
	}

	public void setLastlogin(Date lastlogin) {
		this.lastlogin = lastlogin;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}

	public String getCreateTime() {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return formatter.format(createTime);
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getAuthInfo() {
		return authInfo;
	}

	public void setAuthInfo(String authInfo) {
		this.authInfo = authInfo;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void convert(User user) {
		this.id = user.getId();
		this.email = user.getEmail();
		this.username = user.getUsername();
		this.password = user.getPassword();
		this.parentId = user.getParentId();
		this.groupId = user.getGroupId();
		this.lastlogin = user.getLastlogin();
		this.createTime = user.getCreateTime();
		this.remark = user.getRemark();
	}

}
